<?php

/**
 * Check if the current user has the right to do a specific operation
 * @package ModuleAdministratif
 * @version 1.0b
 * @return 'yes' or 'no'
 */

session_start();

// Configuration file
include '../configuration.php';
// Functions
include '../inc/functions.php';

// Checking if user is logged in
if (!CheckSession()):
	exit();
endif;

// Include all objects
// TODO: Include only needed classes
foreach (glob($configuration['webroot'].'objects/*.php') as $class) { include_once $class; }

$credentials = unserialize($_SESSION['current_credentials']);

if ($credentials->all == 1)
	echo 'yes';
else
	echo ($credentials->$_POST['operation'] == 1) ? 'yes' : 'no'; 
?>